﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Kelper.ViewModels
{
    public class PagingInfo
    {       
        public int TotalItems { get; set; }
        public int ItemsPerPage { get; set; }
        public int CurrentPage { get; set; }

        public int TotalPages { get { return (int)Math.Ceiling((decimal)TotalItems / ItemsPerPage); } }

        public PagingInfo()
        {
            ItemsPerPage = 1; // Default value so get TotalPages doesnt crash with divide by zero
        }
    }
}
